cmake_minimum_required(VERSION 3.19)
project(01_Multi_Language_Interface LANGUAGES CXX)

find_package(Qt6 6.5 REQUIRED COMPONENTS Core Widgets LinguistTools)

qt_standard_project_setup()

qt_add_executable(01_Multi_Language_Interface
    WIN32 MACOSX_BUNDLE
    main.cpp
    mainwindow.cpp
    mainwindow.h
    mainwindow.ui
    res.qrc
)

qt_add_translations(01_Multi_Language_Interface TS_FILES Chinese_Simplified.ts)

qt_add_translations(
    TARGETS 01_Multi_Language_Interface
    TS_FILES Chinese_Simplified.ts
)

target_link_libraries(01_Multi_Language_Interface
    PRIVATE
        Qt::Core
        Qt::Widgets
)

include(GNUInstallDirs)

install(TARGETS 01_Multi_Language_Interface
    BUNDLE  DESTINATION .
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

qt_generate_deploy_app_script(
    TARGET 01_Multi_Language_Interface
    OUTPUT_SCRIPT deploy_script
    NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
